import logging, yagmail, time


def log():
    t = time.strftime('%Y%m%d%H%M%S', time.localtime())
    tt = 'yk' + t + '.log'
    logging.basicConfig(filename='api_test.log',
                        filemode='w+',
                        format='%(levelname)--%(asctime)--%(messages)',
                        level=logging.INFO
                        )
    return tt


def fasong(aa):
    r = yagmail.SMTP(to='2796502172@qq.com', password='gzxbqpmttpesdcig', host='smtp.qq.com')
    r.send(to='2796502172@qq.com', subject='图书管理系统接口测试报告', contents='请查收', attachments=aa)
